<!DOCTYPE html>
<!-- 
Template Name: Metronic - Responsive Admin Dashboard Template build with Twitter Bootstrap 3.1.1
Version: 2.0.2
Author: KeenThemes
Website: http://www.keenthemes.com/
Contact: support@keenthemes.com
Purchase: http://themeforest.net/item/metronic-responsive-admin-dashboard-template/4021469?ref=keenthemes
License: You must have a valid license purchased only from themeforest(the above link) in order to legally use the theme for your project.
-->
<!--[if IE 8]> <html lang="en" class="ie8 no-js"> <![endif]-->
<!--[if IE 9]> <html lang="en" class="ie9 no-js"> <![endif]-->
<!--[if !IE]><!-->
<!--<![endif]-->
<!-- BEGIN HEAD -->
<!-- BEGIN BODY -->
<body class="page-header-fixed">
	<!-- BEGIN CONTAINER -->
	<!-- BEGIN CONTENT -->
	<!--表格操作按钮组-->
	<div>
		<a class="btn blue" href="javascript:;"
			data-target="#accountingRuleModel" data-toggle="modal"
			ng-click="addAccountingRule();"> <i class="fa fa-plus"></i> 新增
		</a>
	</div>
	<table class="table table-striped table-bordered table-hover"
		id="table_1">
		<thead>
			<tr>
				<th>服务名称</th>
				<th>结算类型</th>
				<th>一级科目</th>
				<th>二级科目</th>
				<th>借贷标志</th>
				<th>余额标志</th>
				<th>是否使用</th>
				<th>操作</th>
			</tr>
		</thead>
		<tbody>
			<tr class="odd gradeX"
				ng-repeat="accountingRule in accountingRuleList  track by $index"
				on-loaded="{{$last}}" target-table="table_1">
				<td><span
					ng-bind="accountingRule.serviceNo | getValueInArgFilter : orderServiceMap : 'name'"></span>
				</td>
				<td><span
					ng-bind="accountingRule.cprtBalType | getValueInStaticFilter : 'cprtBalTypeArray'"></span>
				</td>
				<td><span
					ng-bind="accountingRule.subjectCode | getValueInArgFilter : subjectMap : 'subjectName'"></span>
				</td>
				<td><span
					ng-bind="accountingRule.subSubjectCode | getValueInArgFilter : subjectMap : 'subjectName'"></span>
				</td>
				<td><span
					ng-bind="accountingRule.loanFlag | getValueInStaticFilter : 'loanFlagArray'"></span>
				</td>
				<td><span
					ng-bind="accountingRule.balanceFlag | getValueInStaticFilter : 'balanceFlagArray'"></span>
				</td>
				<td><span
					ng-bind="accountingRule.isValid | getValueInStaticFilter : 'validArray'"></span>
				</td>
				<td><a class="btn" href="javascript:;"
					data-target="#accountingRuleModel" data-toggle="modal"
					ng-click="updateAccountingRule(accountingRule);"> 修改 </a></td>
			</tr>
		</tbody>
	</table>

	<div id="accountingRuleModel" class="modal fade" role="dialog"
		aria-hidden="true" data-backdrop="false">
		<div class="modal-dialog">
			<div class="modal-content">
				<div class="modal-header">
					<button type="button" class="close" data-dismiss="modal"
						aria-hidden="true">×</button>
					<h4 class="modal-title">主服务记账规则新增/修改</h4>

				</div>
				<div class="modal-body form">
					<div class="form-group">
						<div class="row">
							<label class="col-sm-4 control-label text-right">主服务</label>
							<div class="col-sm-8">
								<div class="input-group">
									<select class="form-control  bValidate"   key="required"
										ng-options="orderService.serviceNo as orderService.name for orderService in rootOrderService"
										ng-model="selectedAccountingRule.serviceNo">
										<option value="">请选择主服务</option>
									</select>
								</div>
							</div>
						</div>
						<div class="row">
							<label class="col-sm-4 control-label text-right">结算类型</label>
							<div class="col-md-8">
								<div class="radio-list">
									<label  class="radio-inline col-md-4" style="margin:0px;padding: 0px"> <input class="bValidate"
										key="required" ng-model="selectedAccountingRule.cprtBalType"
										type="radio" name="selectedAccountingRule.cprtBalType"
										value="0" ng-selected="selectedAccountingRule.cprtBalType==0">
										周期结算
									</label> <label  class="radio-inline col-md-4" style="margin:0px;padding: 0px"> <input
										ng-model="selectedAccountingRule.cprtBalType" type="radio"
										name="selectedAccountingRule.cprtBalType" value="1"
										ng-selected="selectedAccountingRule.cprtBalType==1">
										实时到账
									</label>
								</div>
							</div>
						</div>
						<div class="row">
							<label class="col-sm-4 control-label text-right">一级科目</label>
							<div class="col-sm-8">
								<div class="input-group">
									<select class="form-control  bValidate"   key="required"
										ng-options="subject.subjectCode as subject.subjectName  for subject in assetsLbltsAccountRuleSubject "
										ng-model="selectedAccountingRule.subjectCode"
										ng-change="showSubject()">
										<option value="">请选择一级科目</option>
									</select>
								</div>
							</div>
						</div>
						<div class="row">
							<label class="col-sm-4 control-label text-right">二级科目</label>
							<div class="col-sm-8">
								<div class="input-group">
									<select class="form-control  bValidate"   key="required"
										ng-options="subject.subjectCode as subject.subjectName for subject in childrenSubject "
										ng-model="selectedAccountingRule.subSubjectCode">
										<option value="">请选择二级科目</option>
									</select>
								</div>
							</div>
						</div>
						<div class="row">
							<label class="col-sm-4 control-label text-right">借贷标志</label>
							<div class="col-md-8">
								<div class="radio-list">
									<label  class="radio-inline col-md-4" style="margin:0px;padding: 0px"> 
									 <input  class="bValidate" key="required" 
										ng-model="selectedAccountingRule.loanFlag" type="radio"  
										value="0" name="selectedAccountingRule.loanFlag"
										ng-selected="selectedAccountingRule.loanFlag==0"> 借
									</label> <label  class="radio-inline col-md-4" style="margin:0px;padding: 0px"> <input
										ng-model="selectedAccountingRule.loanFlag" type="radio"
										value="1" name="selectedAccountingRule.loanFlag"
										ng-selected="selectedAccountingRule.loanFlag==1"> 贷
									</label>
								</div>
							</div>
						</div>
						<div class="row">
							<label class="col-sm-4 control-label text-right">余额标志</label>
							<div class="col-md-8">
								<div class="radio-list">
									<label  class="radio-inline col-md-4" style="margin:0px;padding: 0px"> 
									<input   class="bValidate" key="required" 
										ng-model="selectedAccountingRule.balanceFlag" type="radio"
										name="selectedAccountingRule.balanceFlag" value="1"
										ng-selected="selectedAccountingRule.balanceFlag==1">
										增加
									</label> <label  class="radio-inline col-md-4" style="margin:0px;padding: 0px"> <input
										ng-model="selectedAccountingRule.balanceFlag" type="radio"
										name="selectedAccountingRule.balanceFlag" value="0"
										ng-selected="selectedAccountingRule.balanceFlag==0">
										减少
									</label>
								</div>
							</div>
						</div>
						<div class="row">
							<label class="col-sm-4 control-label text-right">是否启用</label>
							<div class="col-md-8">
								<div class="radio-list">
									<label  class="radio-inline col-md-4" style="margin:0px;padding: 0px"> 
									<input  class="bValidate" key="required" 
										ng-model="selectedAccountingRule.isValid" type="radio"
										value="1" name="selectedAccountingRule.isValid"
										ng-selected="selectedAccountingRule.isValid==1"> 启用
									</label> <label  class="radio-inline col-md-4" style="margin:0px;padding: 0px"> 
									<input
										ng-model="selectedAccountingRule.isValid" type="radio"
										value="0" name="selectedAccountingRule.isValid"
										ng-selected="selectedAccountingRule.isValid==0"> 停用
									</label>
								</div>
							</div>
						</div>
					</div>
				</div>
				<div class="modal-footer">
					<button type="button" class="btn btn-danger" data-dismiss="modal">
						<i class="fa fa-times"></i>关闭
					</button>
					<button type="button" class="btn btn-primary"
						ng-click="modifyAccountingRule();">
						<i class="fa fa-check"></i>保存
					</button>
				</div>
			</div>
		</div>
	</div>
	</div>
	<!-- END CONTENT -->

	<!-- END CONTAINER -->

	<!-- BEGIN JAVASCRIPTS(Load javascripts at bottom, this will reduce page load time) -->
	<!-- BEGIN CORE PLUGINS -->



</body>
<!-- END BODY -->
</html>
